#pragma once

#include "dbcDefine.h"
#include "IDatabaseConnManage.h"

LIBDBC_BEGIN_NAMESPACE

extern char gszGPLtext[];
extern char gszWarranty[];
extern char gszConditions[];

enum LIBDBC_API DatabaseManageSystemT
{
	DBMS_SqLite = 0,
	DBMS_MySQL = 1,
	DBMS_ODBC = 2, 
	DBMS_SQLSERVER = 3,
	DBMS_ORACLE = 4,
	DBMS_POSTGRESQL = 5,
};

class LIBDBC_API dbcFactory
{
public:
	static const unsigned int dbmsCount = 7;
	static const char* szDbmsNames[];

public:
	dbcFactory();
	~dbcFactory();

	static IDatabase* createDatabaseInterface(DatabaseManageSystemT dbms);
	static IDatabase* createDatabaseInterface(const char* dbmsname);
	static void freeDatabaseInterface(IDatabase** pdbo);
	static const char* version();

	static const char** getListOfDBMS();
	static unsigned int getCountOfDBMS();
	static bool createDatabaseConnectionManager(IDatabaseConnManage** ppmgr);
	static bool freeDatabaseConnectionManager(IDatabaseConnManage** ppmgr);
};

LIBDBC_END_NAMESPACE